package net.lab1024.sa.admin.module.business.erp.mmo.controller;

import net.lab1024.sa.admin.module.business.erp.mmo.domain.form.MrqordAddForm;
import net.lab1024.sa.admin.module.business.erp.mmo.domain.form.MrqordQueryForm;
import net.lab1024.sa.admin.module.business.erp.mmo.domain.form.MrqordUpdateForm;
import net.lab1024.sa.admin.module.business.erp.mmo.domain.vo.MrqordVO;
import net.lab1024.sa.admin.module.business.erp.mmo.service.MrqordService;
import net.lab1024.sa.base.common.domain.ValidateList;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import net.lab1024.sa.base.common.domain.ResponseDTO;
import net.lab1024.sa.base.common.domain.PageResult;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Operation;

import javax.annotation.Resource;
import javax.validation.Valid;

/**
 * 生产领料单 Controller
 *
 * @Author AKITA
 * @Date 2025-08-18 10:37:56
 * @Copyright AKITA
 */

@RestController
@Tag(name = "生产领料单")
public class MrqordController {

    @Resource
    private MrqordService mrqordService;

    @Operation(summary = "分页查询 @author AKITA")
    @PostMapping("/mrqord/queryPage")
    public ResponseDTO<PageResult<MrqordVO>> queryPage(@RequestBody @Valid MrqordQueryForm queryForm) {
        return ResponseDTO.ok(mrqordService.queryPage(queryForm));
    }

    @Operation(summary = "添加 @author AKITA")
    @PostMapping("/mrqord/add")
    public ResponseDTO<Long> add(@RequestBody @Valid MrqordAddForm addForm) {
        return mrqordService.add(addForm);
    }
    @Operation(summary = "更新 @author AKITA")
    @PostMapping("/mrqord/update")
    public ResponseDTO<String> update(@RequestBody @Valid MrqordUpdateForm updateForm) {
        return mrqordService.update(updateForm);
    }
    @Operation(summary = "批量删除 @author AKITA")
    @PostMapping("/mrqord/batchDelete")
    public ResponseDTO<String> batchDelete(@RequestBody ValidateList<Long> idList) {
        return mrqordService.batchDelete(idList);
    }
    @Operation(summary = "单个删除 @author AKITA")
    @GetMapping("/mrqord/delete/{id}")
    public ResponseDTO<String> batchDelete(@PathVariable Long id) {
        return mrqordService.delete(id);
    }

    @Operation(summary = "单个查询 @author AKITA")
    @GetMapping("/mrqord/info/{id}")
    public ResponseDTO<MrqordVO> info(@PathVariable Long id) {
        return mrqordService.info(id);
    }



    @Operation(summary = "单个查询 @author AKITA")
    @GetMapping("/mrqord/infoUnexecute/{id}")
    public ResponseDTO<MrqordVO> infoUnexecute(@PathVariable Long id) {
        return mrqordService.infoUnexecute(id);
    }
}
